﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Dynamic;
using System.Data.Entity;
using BugTracker.DataAccess.Data;

namespace BugTracker.BusinessLogic.Issue
{
    public class IssueStatusTypeMapper : IIssueStatusTypeMapper
    {
        #region IIssueStatusTypeMapper Members

        public DataAccess.Data.IssueStatusType Map(BusinessEntities.Entities.Issue.IssueStatusType value)
        {
            DataAccess.Data.IssueStatusType result = new DataAccess.Data.IssueStatusType();
            result.IssueStatusTypeID = value.IssueStatusTypeID;
            result.Name = value.Name;
            result.Image = value.Image;
            result.IsActive = value.IsActive;
            result.IsDeleted = value.IsDeleted;
            result.RowGuid = value.RowGuid;
            result.CreatedOn = value.CreatedOn;
            result.ModifiedOn = value.ModifiedOn;
            return result;
        }

        public BusinessEntities.Entities.Issue.IssueStatusType Map(DataAccess.Data.IssueStatusType value)
        {
            BusinessEntities.Entities.Issue.IssueStatusType result = new BusinessEntities.Entities.Issue.IssueStatusType();
            result.IssueStatusTypeID = value.IssueStatusTypeID;
            result.Name = value.Name;
            result.Image = value.Image;
            result.IsActive = value.IsActive;
            result.IsDeleted = value.IsDeleted;
            result.RowGuid = value.RowGuid;
            result.CreatedOn = value.CreatedOn;
            result.ModifiedOn = value.ModifiedOn;
            return result;
        }

        public void Map(DataAccess.Data.IssueStatusType result, BusinessEntities.Entities.Issue.IssueStatusType value, bool includeKey = false)
        {
            if (includeKey)
            {
                value.IssueStatusTypeID = result.IssueStatusTypeID;
            }
            value.Name = result.Name;
            result.Image = value.Image;
            value.IsActive = result.IsActive;
            value.IsDeleted = result.IsDeleted;
            value.RowGuid = result.RowGuid;
            value.CreatedOn = result.CreatedOn;
            value.ModifiedOn = result.ModifiedOn;
        }

        public void Map(BusinessEntities.Entities.Issue.IssueStatusType result, DataAccess.Data.IssueStatusType value, bool includeKey = false)
        {
            if (includeKey)
            {
                value.IssueStatusTypeID = result.IssueStatusTypeID;
            }
            value.Name = result.Name;
            result.Image = value.Image;
            value.IsActive = result.IsActive;
            value.IsDeleted = result.IsDeleted;
            value.RowGuid = result.RowGuid;
            value.CreatedOn = result.CreatedOn;
            value.ModifiedOn = result.ModifiedOn;
        }

        #endregion
    }
}
